package com.example.zg3_park.RepairOrder

import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.lib_base.mvvm.BaseActivity
import com.example.zg3_park.databinding.ActivityRepairBinding
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch

@AndroidEntryPoint
@Route(path = "/app/RepairActivity")
class RepairActivity : BaseActivity<ActivityRepairBinding,RepairViewModel>() {
    private val repairAdapter by lazy { RepairAdapter() }

    override fun intiView() {
        binding.rvRepair.apply {
            adapter = repairAdapter
            layoutManager = LinearLayoutManager(this@RepairActivity)
        }
    }

    override fun intiData() {
        lifecycleScope.launch {
            vm.getRepair().collect() {
                repairAdapter.submitData(it)
            }
        }

    }
}